package cn.fay.chapter18;

import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

public class PreferencesDemo {

	public static void main(String[] args) throws BackingStoreException {
		Preferences prefs=Preferences.userNodeForPackage(PreferencesDemo.class);
		prefs.put("Location", "北京");
		prefs.putInt("age", 24);
		prefs.putBoolean("isMarried", false);
		
		for (String key : prefs.keys()) {
			System.out.println(key+" "+prefs.get(key, null));
		}
	}

}
